﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using WalkingTec.Mvvm.Core;
using System.Text.Json.Serialization;
using Digitalmes.Model;
using Digitalmes.Model.EquipmentManagement;

namespace Digitalmes.Model.EquipmentManagement
{
    /// <summary>
    /// EquipmentSpotTable
    /// </summary>
	[Table("EquipmentSpotTable")]

    [Display(Name = "_Model.EquipmentSpotTable")]
    public class EquipmentSpotTable : BasePoco,IPersistPoco,ITenant
    {
        [Key]
        [Display(Name = "_Model._Equipment._ID")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public new long ID { get; set; }

        [Comment("表单号")]
        [StringLength(255, ErrorMessage = "Validate.{0}stringmax{1}")]
        public string FormNo { get; set; }


        [Display(Name = "_Model._EquipmentSpotRecord._Status")]
        [Comment("点检结果")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public SpotStatusEnum Status { get; set; }

        [Display(Name = "_Model._EquipmentSpotTable._Equipment")]
        [Comment("关联设备")]
        public Equipment Equipment { get; set; }
        [Display(Name = "_Model._EquipmentSpotTable._Equipment")]
        [Comment("关联设备")]
        public long? EquipmentId { get; set; }
        [Display(Name = "_Model._EquipmentSpotTable._LineId")]
        [Comment("产线")]
        public long? LineId { get; set; }
        [Display(Name = "_Model._EquipmentSpotTable._LineCode")]
        [Comment("产线编号")]
        public string LineCode { get; set; }
        [Display(Name = "_Model._EquipmentSpotTable._OpId")]
        [Comment("工位")]
        public long? OpId { get; set; }
        [Display(Name = "_Model._EquipmentSpotTable._OpCode")]
        [Comment("工位编号")]
        public string OpCode { get; set; }
        [Display(Name = "_Model._EquipmentSpotTable._UseOperator")]
        [Comment("操作员")]
        public string UseOperator { get; set; }
        [Display(Name = "_Model._EquipmentSpotRecord._SpotTable")]
        [InverseProperty("SpotTable")]
        public List<EquipmentSpotRecord> EquipmentSpotRecord_SpotTable { get; set; }
        [Display(Name = "_Model._EquipmentSpotTable._IsValid")]
        [Comment("是否有效")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public bool IsValid { get; set; } = true;
        [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
        public string TenantCode { get; set; }

	}

}
